import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		component: () => import('@/views/Main'),
		children: [
			{ path: '/', name: 'Home', component: () => import('@/views/Home') },
			{
				path: '/catelist',
				name: 'CateList',
				component: () => import('@/views/CateList')
			},
			{ path: '/cart', name: 'Cart', component: () => import('@/views/Cart') }
		]
	},
	{
		path: '/register',
		name: 'Register',
		component: () => import('@/views/Register')
	},
	{
		path: '/login',
		name: 'Login',
		component: () => import('@/views/Login')
	},
	{
		path: '/good',
		name: 'Good',
		component: () => import('@/views/Good')
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
